package com.hd.service.test;

import java.util.List;

import com.hd.common.DataPage;
import com.hd.persistence.model.PartUsage;
import com.hd.utils.HdException;

public class PartUsageManagerTestCase extends BaseTest {
	
	//保存实体
//	public void testSavePartUsage() throws HdException {
//		RepairReport repairReport = new RepairReport();
//		repairReport.setRepairReportId(1L);
//		for ( int i = 0; i < 3; i++ ) {
//			PartUsage partUsage = new PartUsage();
//			partUsage.setRepairReport(repairReport);
//			partUsage.setPartName("零件名" + i);
//			partUsage.setPartNo("00" + i);
//			partUsage.setPrice(200);
//			partUsage.setAmount(3000);
//			repairManager.savePartUsage(partUsage);
//		}
//	}
	
	//分页查询零件使用
	public void testPageQueryPartUsages() throws HdException {
		DataPage<PartUsage> dataPage = repairManager.pageQueryPartUsages(1, 10);
		System.out.println("查询总数为:" + dataPage.getTotalCount());
		List<PartUsage> partUsages = dataPage.getData();
		for ( PartUsage partUsage : partUsages ) {
			System.out.println(partUsage.getPartUsageId() + " " + partUsage.getPartName());
		}
	}

}
